package com.marchsoft.musicalstore.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.*;
/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ${源}
 * Date: 2019-11-17
 * Time: 11:09
 */

@Entity
@Table(name = "instrument")
@JsonIgnoreProperties(value = { "hibernateLazyInitializer"})
public class Instrument {
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getPrice() {
        return price;
    }

    public void setPrice(int price) {
        this.price = price;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAllCount() {
        return allCount;
    }

    public void setAllCount(int allCount) {
        this.allCount = allCount;
    }

    public int getNowCount() {
        return nowCount;
    }

    public void setNowCount(int nowCount) {
        this.nowCount = nowCount;
    }

    public String getImg() {
        return img;
    }

    public void setImg(String img) {
        this.img = img;
    }

    public String getIntro() {
        return intro;
    }

    public void setIntro(String intro) {
        this.intro = intro;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private int id;
    private int type;//种类
    private int price;//价格
    private String name;//品牌
    @Column(name = "all_count")
    private int allCount;//总数量
    @Column(name = "now_count")
    private int nowCount;//现有数量
    private String img;//图片
    private String intro;//详情
    private int state;//商品存在状态

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public Instrument() {

    }

    public Instrument(int type, int price, String name, int allCount, int nowCount, String img, String intro, int state) {
        this.type = type;
        this.price = price;
        this.name = name;
        this.allCount = allCount;
        this.nowCount = nowCount;
        this.img = img;
        this.intro = intro;
        this.state = state;
    }

    @Override
    public String toString() {
        return "Instrument{" +
                "id=" + id +
                ", type=" + type +
                ", price=" + price +
                ", name='" + name + '\'' +
                ", allCount=" + allCount +
                ", nowCount=" + nowCount +
                ", img='" + img + '\'' +
                ", intro='" + intro + '\'' +
                '}';
    }
}
